﻿@model TaskManager.Models.ProjectModel
@{
    ViewBag.Title = "Add Project";
    var isEdit = (Model != null && Model.Id > 0);
}

@section breadcrumb
{
    <li>@Html.ActionLink("Project Manager", "Index", "Project")</li>
    @if (isEdit)
    {
        <li>@Html.ActionLink("Edit Project", "Edit", "Project")</li>
    }
    else
    {
        <li>@Html.ActionLink("Add Project", "Create", "Project")</li>
    }
}

<div class="box box-primary">
    <div class="box-header">
        @if (isEdit)
        {
            <h3 class="box-title">Edit Project</h3>
        }
        else
        {
            <h3 class="box-title">Add Project</h3>              
        }
    </div>
    <!-- /.box-header -->
    <!-- form start -->

    @using (Html.BeginForm(isEdit ? "Edit" : "Create"))
    {
        @Html.AntiForgeryToken()
        <div class="box-body">
            <div class="form-group">
                <div class="col-md-6">
                    @Html.HiddenFor(m => m.Id)
                    @Html.LabelFor(m => m.Name)

                    @Html.TextBoxFor(m => m.Name, new { @class = "form-control" })
                </div>
                <div class="col-md-6">
                    @Html.LabelFor(m => m.StartAndEndDate)
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class="fa fa-calendar"></i>
                        </div>
                        @Html.TextBoxFor(m => m.StartAndEndDate, new { @class = "form-control pull-right" })
                    </div><!-- /.input group -->
                    
                </div>
            </div>
            <div class="form-group padding-10">
                @Html.LabelFor(m => m.Description)
                @Html.TextAreaFor(m => m.Description, new { @class = "form-control", rows = "5" })
            </div>

            @Html.ValidationSummary(true)
        </div>
        <div class="clear"></div>
        <!-- /.box-body -->
        <div class="box-footer">
            <button type="submit" class="btn btn-primary">Save</button>
            <a href="@Url.Action("Index")" class="btn btn-primary">Cancel</a>
        </div>
    }
</div>
@section Script
{
    <script type="text/javascript">
        $(function () {
            //Datetime mask
            $('#StartAndEndDate').daterangepicker({ format: 'MM/DD/YYYY' });
        });
    </script>
}

 